package cn.stylefeng.guns.sys.modular.system.mapper;

import cn.stylefeng.guns.sys.modular.system.entity.AttendAuditBtyArchives;
import cn.stylefeng.guns.sys.modular.system.entity.AttendAuditBtyArea;
import cn.stylefeng.guns.sys.modular.system.entity.BtyPerformanceMonthCheck;
import cn.stylefeng.guns.sys.modular.system.entity.BtyPerformanceMonthConfig;
import cn.stylefeng.guns.sys.modular.system.model.params.BtyPerformanceMonthCheckParam;
import cn.stylefeng.guns.sys.modular.system.model.params.BtyPerformanceReceiveParam;
import cn.stylefeng.guns.sys.modular.system.model.result.BtyDdpageByAccountTime;
import cn.stylefeng.guns.sys.modular.system.model.result.BtyPerformanceMonthCheckResult;
import cn.stylefeng.guns.sys.modular.system.model.result.BtyPerformanceMonthInformationResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author wjk
 * @since 2022-02-10
 */
public interface BtyPerformanceMonthCheckMapper extends BaseMapper<BtyPerformanceMonthCheck> {

    /**
     * 获取列表
     *
     * @author wjk
     * @Date 2022-02-10
     */
    List<BtyPerformanceMonthCheckResult> customList(@Param("paramCondition") BtyPerformanceMonthCheckParam paramCondition);

    /**
     * 获取map列表
     *
     * @author wjk
     * @Date 2022-02-10
     */
    List<Map<String, Object>> customMapList(@Param("paramCondition") BtyPerformanceMonthCheckParam paramCondition);

    /**
     * 获取分页实体列表
     *
     * @author wjk
     * @Date 2022-02-10
     */
    Page<BtyPerformanceMonthCheckResult> customPageList(@Param("page") Page page, @Param("paramCondition") BtyPerformanceMonthCheckParam paramCondition);

    /**
     * 获取分页map列表
     *
     * @author wjk
     * @Date 2022-02-10
     */
    Page<Map<String, Object>> customPageMapList(@Param("page") Page page, @Param("paramCondition") BtyPerformanceMonthCheckParam paramCondition);

    /**
     * 根据妖码，查询这个店的信息
     *
     * @author wjk
     * @Date 2021-02-14
     */
    List<BtyDdpageByAccountTime> getBtyDdpageByYaoma(@Param("param") BtyPerformanceReceiveParam param);

    /**
     * 根据店的列表查询,和做绩效的职位查询用户信息
     *
     * @author wjk
     * @Date 2021-02-15
     */
    IPage<AttendAuditBtyArchives> getBtyArchives(@Param("page") Page page, @Param("param") BtyPerformanceReceiveParam param, @Param("yydh") String yydh, @Param("performanceList") List<BtyPerformanceMonthConfig> performanceList);

    /**
     * 同步督导做的绩效数据到绩效表，这个地方先不进行调用，到正式要用的时候需要先跟人事确认
     * todo 等人事通知
     * 2022-03-02
     * @param param
     * @return
     */
    int btyPerformanceForSuccess(@Param("param") BtyPerformanceMonthCheckParam param);

    /**
     * 19  运营经理提交驳回，原因，列表
     * @author wjk
     * @Date 2022-04-06
     */
    Boolean updateRejectById(@Param("id") Long id);



    /**
     * 批量增加驳回信息
     * @param list
     * @return
     */
    int addDismissedList(@Param("list") List<BtyPerformanceMonthInformationResult> list);


    /**
     * 批量增加驳回信息总
     * @param param
     * @return
     */
    int addDismissedServiceOne(@Param("param") BtyPerformanceMonthInformationResult param);



    /**
     * 批量通过
     * @param
     * @return
     */
    int setCheckAuditApproved(@Param("list")  List<Long> btyPerformanceMonthCheckIdList);

    /**
     * 将此单的所有驳回状态修改为历史记录
     * @param btyPerformanceMonthCheckId
     * @return
     */
    boolean updateDismissedHistorytryById(@Param("btyPerformanceMonthCheckId") Long btyPerformanceMonthCheckId);

    /**
     * 获取该店审核状态
     * @param time
     * @param yaoma
     * @return
     */
    BtyPerformanceMonthCheck getByYm(@Param("time") String time, @Param("yaoma") String yaoma);
}
